mystack=[]
mystack.append(5)
lastnum=0
while  len(mystack)!=0:
    data=mystack.pop()#弹出数据
    print(data)
    lastnum+=data
    if  data==0:
        break
    else :
        mystack.append(data-1)



print(lastnum)